<?php
class DigCms_View_Helper_DigCmsImage extends Zend_View_Helper_HtmlElement
{
    /**
     * renders an image from a DigCms_Model_Image object
     *
     * @param DigCms_Model_Image $image
     * @param <array> $attribs
     * @return <xhtml>
     */
    public function digCmsImage(DigCms_Model_Image $image, $attribs = array()) {
        if(file_exists(DOCUMENT_ROOT . $image->filepath)) {
            $attributes = $this->_htmlAttribs($attribs);
            return sprintf('<img src="%s" %s />', $image->filepath, $attributes);
        }
    }
}
?>
